package com.biz.primus.ms.product.feign;

import com.biz.primus.base.vo.StockRespVo;
import com.biz.primus.commodity.vo.frontend.ProductStockReqProductVo;
import com.biz.primus.commodity.vo.frontend.TypeBProductStockVo;
import com.biz.primus.model.stock.vo.StocksReqVo;
import com.biz.primus.ms.product.degraded.DegradedStockFeignClient;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(qualifier = "stockFeignClient", name = "service-stock",fallback = DegradedStockFeignClient.class)
public interface StockFeignClient {


    @PostMapping(value = "getDepotStockInBatch")
    public List<StockRespVo> getDepotsStockInBatch(@RequestBody StocksReqVo reqVo);


    @PostMapping("getTypeAProductStock")
    List<Integer> getTypeAProductStock(@RequestBody List<String> typeAProductCodes);

    @PostMapping("getTypeBProductStocks")
    List<TypeBProductStockVo> getTypeBProductStocks(@RequestBody List<ProductStockReqProductVo> productStockReqProductVos,
                                                    @RequestParam("depotCode") String depotCode,
                                                    @RequestParam("warehouseDepotCode") String warehouseDepotCode);

    @PostMapping("getTypeBProductStock")
    TypeBProductStockVo getTypeBProductStock(@RequestBody ProductStockReqProductVo reqVo, @RequestParam("depotCode") String depotCode,
                                             @RequestParam("warehouseDepotCode") String warehouseDepotCode);

    @GetMapping("getTypeAProductStock")
    Integer getTypeAProductStock(@RequestParam("productCode") String productCode);

}
